// 获取钥匙列表
export const getList = (username)=>{
   return uni.$u.http.get(`/api/recharge/authorization/list?username=${username}`)
}
export const getListByID = (data)=>{
   return uni.$u.http.get(`/api/recharge/authorization/list?keyId=${data}`)
}
// 获取授权列表 需要字段：被授权人账号，授权时间，授权权限，备注
export const getListAuthorization = (id)=>{
   return uni.$u.http.get(`/api/recharge/authorization/list?keyId=${id}`)
}

// 申请钥匙授权
export const authorization = (data)=>{
	return uni.$u.http.post("/api/recharge/authorization",data)
}

// 注销授权钥匙
export const cancelAuthorization = (id)=>{
	return uni.$u.http.delete("/api/recharge/authorization/"+id)
}
//注销智能钥匙
export const cancelkey = (id)=>{
	return uni.$u.http.delete("/api/recharge/key/"+id)
}

// 设置默认钥匙
export const setDefault = (data)=>{
   return uni.$u.http.put("/api/recharge/key/setDefault",data)
}

export const submitAuthorization = (data)=>{
    return uni.$u.http.post("/api/recharge/authorization",data)
}
